package com.brillilab.service.core.kit;

import com.brillilab.common.entity.PageVo;
import com.brillilab.domain.po.kit.KitUsage;
import com.brillilab.domain.vo.home.HomeChartVo;
import com.brillilab.domain.vo.home.HomeMaterielVo;
import com.brillilab.domain.vo.kit.DeviceUnlock;
import com.brillilab.domain.vo.kit.KitUsageVo;

import java.util.Date;
import java.util.List;

/**
 * 取用/待归还清单
 */
public interface IKitUsageService {

    List<KitUsage> selectList(Long labId,Long labMemberId,Integer... state);

    boolean insert(KitUsage kitUsage);

    KitUsage selectOne(Long id);

    KitUsage selectOne(Long usageId,Long labId,Long labMemberId,Integer state);

    boolean deleteById(Long id);

    boolean deleteBatch(List<Long> itemIds);

    boolean update(KitUsage kitUsage);

    /**
    * @Description: TODO
    * @Params: [list]
    * @return java.lang.Integer
    * @author wuzhiyu
    * @date 2018/11/23 14:48
    */
    Integer saveTakeList(List<KitUsage> list);

    List<KitUsage> selectList(Long labId,Long labMemberId,Date usageTime,Integer... states);

    Integer insertBatch(List<KitUsage> kitUsages);

    Integer updateBatch(List<KitUsage> updateList);

    int selectCount(Long labId,Long labMemberId,Integer... value);

    PageVo<KitUsageVo> getKitUsageVoPage(Long labId,Long labMemberId,Integer pageNum,Integer pageSize,Integer... state);

    List<KitUsage> selectList(Long inventoryId,Integer state);

    List<KitUsage> selectByKitId(Long kitId,Integer state);

    List<KitUsageVo> getKitUsageVoList(Long labId,Long labMemberId,Integer... states);

    List<KitUsageVo> getKitUsageVoList(List<Long> usageId,Integer... states);

    List<KitUsage> selectList(List<Long> kitUsageIds);

    List<KitUsage> selectListInOneDevice(Long deviceId,Long labMemberId,Long labMemberId1,Integer state);

    DeviceUnlock selectKitUsageDeviceUnLock(Long usageId);

    List<DeviceUnlock> selectKitUsageDeviceUnLockList(List<Long> kitUsageIds);

    List<KitUsage> selectListByExperimentId(Long experimentId);

    KitUsageVo getKitUsageVo(Long id);

    int selectExperimentUsageCount(Long labId,Long labMemberId,Long experimentId,Integer... state);

    boolean setUsageToTakeMiss(List<Long> notReturnIds);

    boolean setUsageToReturnMiss(List<Long> returnedIds);

    PageVo<KitUsageVo> getNotRetureUsageList(Long labMemberId,Integer state,Integer pageNum,Integer pageSize);

    PageVo<KitUsageVo> getHistoryKitUsageVoPage(Long labId,Long labMemberId,Integer pageNum,Integer pageSize);

    boolean setUsageToNotTakeSuccess(List<Long> returnedIds);

    boolean setUsageToNotReturnSuccess(List<Long> returnedIds);

    List<KitUsage> selectListInInventoryIds(List<Long> inventoryIds,Integer... states);

	List<HomeChartVo> getSevenDaysUsageChart(Long labMemberId);

	HomeMaterielVo getMaterielVo(Long labMemberId);

    int deleteByStepId(Long stepId);

	int selectWaitGiveBackCount(Long experimentId);

    /**
     * 获取指定成员在一定时间内的取用列表
     * @param labId
     * @param labMemberId
     * @param beginDate
     * @param endDate
     * @return
     */
    List<KitUsage> getUsageChartByDateRange(Long labId,Long labMemberId,Date beginDate,Date endDate);
}
